package com.gitee.xhs.window.evictors;

import com.gitee.xhs.sampleRecod.transactionRecord.Transaction;
import org.apache.flink.streaming.api.windowing.windows.TimeWindow;
import org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue;

/**
 * @author BigHead
 * @date 2022/7/27 9:52
 * @description CustomEvictors
 */
public class CustomBeforeEvictors extends AbstractCustomEvictors {

    CustomBeforeEvictors(){
        super(1);
    }

    @Override
    public void evictBefore(Iterable<TimestampedValue<Transaction>> elements, int size, TimeWindow window, EvictorContext evictorContext) {
        removeElement(elements, size);
    }

    @Override
    public void evictAfter(Iterable<TimestampedValue<Transaction>> elements, int size, TimeWindow window, EvictorContext evictorContext) {
    }
}
